//
// Created by 张祎鹤严 on 2023/9/24.
//

/**
  ******************************************************************************
  * @file    driver_can.h
  * @author  XJTU ROBOMASTER Team
  * @brief   This file contains all the USB Sending and receiving function
  ******************************************************************************
  * @attention
  *
  * Please add comments after adding or deleting functions to ensure code
  * specification.
  *
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef BSP_USB_H
#define BSP_USB_H

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "usbd_cdc_if.h"

/* Exported types ------------------------------------------------------------*/

union DataConversion
{
    uint32_t data;
    uint8_t buffer[4];
};

/* Exported variables --------------------------------------------------------*/
/** Received data over USB are stored in this buffer      */
extern uint8_t UserRxBufferFS[APP_RX_DATA_SIZE];

/** Data to send over USB CDC are stored in this buffer   */
extern uint8_t UserTxBufferFS[APP_TX_DATA_SIZE];

/* Exported functions --------------------------------------------------------*/
void VisionRxData(float* position_x, float* position_y, float* position_z, uint8_t* status);

void VisionTxData(float horizontal, float vertical, float velocity, uint8_t status);

#endif //BSP_USB_H

/************************ (C) COPYRIGHT XJTU ROBOMASTER ********END OF FILE****/

